You at the command line, enter:
$ diff
Diff will tell you what the difference is between the two files. Its display result is not very understood, below I will explain, how to read the diff.
bg2012082901
One, diff three kinds of formats
For historical reasons, diff has
system named diffwrap.sh:#!/bin/sh# Configure your favorite diff program here.DIFF="/usr/bin/vimdiff"# Subversion provides the paths we need as the sixth and seventh# parameters.LEFT=${6}RIGHT=${7}# Call the diff command$DIFF$LEFT$RIGHTYou can either put it in a System wide folder (/usr/local/bin) or in your own folde
Linux Tour (1): diff, patch and quilt (lower) 2 quilt
We can use CVs or SVN to manage all code for our own projects. But sometimes we need to use projects maintained by other developers. We need to modify some files, but we cannot directly submit code to the version management tool. It is not appropriate to use version management tools to reconstruct the entire project, because most of the Code is maintained by others, such as the Linux kernel. We jus
Recently, I started to touch git. Learning to Git diff is always confusing. Git diff compares the difference between the two files. After searching the net on the net, finally found Le answer.
There are two cases, one is when there are files in staging area, and the other is no files in staging area.
(1) When there are no files in staging area, git diff compare
In practice, by using Git diff to calculate the number of code changes, there is a need to just count certain types of files (files with special suffix names/extensions), such as: Only the variables for files in the current git repo. java,. xml,. c,. cpp. There are two ways to make git count according to the file suffix name and to count the eligible files in each subdirectory. 1. Use the ' *.java ' and ' *.xml ' directly, if your git version is new
Linux Tour (1): diff, Patch and quilt (bottom) 2 quiltOur own projects can manage all the code with CVS or SVN. But sometimes we use projects that other developers maintain. We need to change some files, but we cannot submit the code directly to the version number management tool. It is inappropriate to rebuild the entire project with version number management tools, because most of the code is maintained by others, such as the Linux kernel. We just w
Linux Tour (1): diff, Patch and quilt (bottom) 2 quiltOur own projects can manage all the code with CVS or SVN. But sometimes we use projects that other developers maintain. We need to change some files, but we cannot submit the code directly to the version number management tool. It is inappropriate to rebuild the entire project with version number management tools, because most of the code is maintained by others, such as the Linux kernel. We just w
Linux Tour (1): diff, Patch and quilt (bottom) 2 quiltOur own projects can manage all the code with CVS or SVN. But sometimes we use projects that other developers maintain. We need to change some files, but we cannot submit the code directly to the version number management tool. It is inappropriate to rebuild the entire project with version number management tools, because most of the code is maintained by others, such as the Linux kernel. We just w
Linux Tour (1): diff, Patch and quilt (bottom) 2 quiltOur own projects can manage all the code with CVS or SVN. But sometimes we use projects that other developers maintain. We need to change some files, but we cannot submit the code directly to the version number management tool. It is inappropriate to rebuild the entire project with version number management tools, because most of the code is maintained by others, such as the Linux kernel. We just w
ist2.txt! This is T2.txt's content.[email protected] document]# diff t1.txt T2.txt>t12.log//Generate patches [[email protected] document]# patch t1.txt t12.log//Patch the T1.txt to make its contents t2.txt content Patchi ng file T1.txt[email protected] document]# cat T1.txt This isA text!Name ist2.txt![[Email protected] document]# patch T2.txt t12.log//to T2.txt patching, but it seems a little different patching file t2.txtreversed (or P reviously a
this parameter can be used for Ed script file,-F or-forward-ed: The output format is similar to Ed's script file, but it shows different places in the order of the original file;-H or--speed-large-files: When comparing large files, Speeds up;-lPR program to pagination;-N or--rcs: Displays the comparison results in RCS format;-N or--new-file: When comparing a directory, if file a only appears in a directory, the preset will display: Only in directory,
comparing files with the same name, the files with different names are treated as new files. For comparison of C program files, diff also provides special parameters (-P, -- show-C-function) to identify the function names of the differences.
There are three types of diff output formats: list mode, command mode, and context mode. Command mode can be divided int
Common Linux commands (28th)-diff
The diff command is an important tool in linux. It is used to compare the content of files, especially files of different versions, to find the changes. Diff prints the changes of each line in the command line. The latest diff version also supports binary files. The output of the
Just in and the company to do offline IP comparison, finally handmade, feeling is still more troublesome, when the data is very large when the manual can not be carried outI want to use the Linux diff to compare, found that the results are very messy. The time is tight and finally it's handmade.Now I'm busy. Learn this command:Content excerpted from the Web:Diff is a very important tool program for UNIX sys
The diff command is an important tool in linux. it is used to compare the content of files, especially files of different versions, to find the changes. The following are detailed instructions and examples.
The diff command is an important tool in linux. it is used to compare the content of files, especially files of different versions, to find the changes. Diff
The diff command is a very important tool on Linux to compare the contents of a file, especially to compare two different versions of files to find the changes. Diff prints each line's changes on the command line. The latest version of diff also supports binary files. The output of the diff
Original URL: http://www.cnblogs.com/peida/archive/2012/12/12/2814048.htmlThe diff command is a very important tool on Linux to compare the contents of a file, especially to compare two different versions of files to find the changes. Diff prints each line's changes on the command line. The latest version of diff also supports binary files. The output of the
I. OverviewDiff and Patch are a pair of complementary tools, mathematically, diff is similar to the difference between two sets, and patches are similar to the and operations on two sets. Diff compares the differences of two files or collections of files and logs them down to generate a diff file, which is also what we often call patch files, which are patches. P
derectory! " Exit 1fi## Note that the Mac Readlink program and the GNU Readlink feature are different, Mac needs to download greadlinkarg1= ' greadlink-f $ ' arg2= ' greadlink-f ' tmp_dir=/ tmp/tmp.$ $rm-rf $tmp _dirmkdir-p $tmp _dir | | Exit 0#echo $tmp _dirtrap "Rm-rf $tmp _dir; Exit 0 "SIGINT sigterm## Note that Mac and Linux MD5 programs are different, please use according to demand, here is the use of Mac version of function get_file_md5{if [$#-
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.